package com.woniu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 文档表
 * @TableName documents
 */
@TableName(value ="documents")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Documents {
    /**
     * 文档id
     */
    @TableId(type = IdType.AUTO)
    private Integer did;

    /**
     * 文档名
     */
    private String documentsName;

    /**
     * 文档地址
     */
    private String doctumentsUrl;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Documents other = (Documents) that;
        return (this.getDid() == null ? other.getDid() == null : this.getDid().equals(other.getDid()))
            && (this.getDocumentsName() == null ? other.getDocumentsName() == null : this.getDocumentsName().equals(other.getDocumentsName()))
            && (this.getDoctumentsUrl() == null ? other.getDoctumentsUrl() == null : this.getDoctumentsUrl().equals(other.getDoctumentsUrl()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDid() == null) ? 0 : getDid().hashCode());
        result = prime * result + ((getDocumentsName() == null) ? 0 : getDocumentsName().hashCode());
        result = prime * result + ((getDoctumentsUrl() == null) ? 0 : getDoctumentsUrl().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", did=").append(did);
        sb.append(", documentsName=").append(documentsName);
        sb.append(", doctumentsUrl=").append(doctumentsUrl);
        sb.append("]");
        return sb.toString();
    }
}